package com.cskaoyan.market.config;

import com.cskaoyan.market.filter.CharFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Arrays;

/**
 * @Author 远志 zhangsong@cskaoyan.onaliyun.com
 * @Date 2024/6/29 9:55
 * @Version 1.0
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Bean
    public FilterRegistrationBean<CharFilter> charFilter(){
        FilterRegistrationBean<CharFilter> bean = new FilterRegistrationBean<>();
        bean.setFilter(new CharFilter());
        bean.setUrlPatterns(Arrays.asList("/wx/*"));
        return bean;
    }
}
